import 'package:flutter_riverpod/flutter_riverpod.dart';

import '../base_notifier.dart';
import '../base_state.dart';
import '../models/user.dart';

final userProvider = StateNotifierProvider<UserNotifier, BaseState<User>>(
  (ref) => UserNotifier(),
);

class UserNotifier extends BaseLoadNotifier<User> {
  @override
  Future<User?> loadData() async {
    // 模拟API调用
    await Future.delayed(const Duration(seconds: 2));
    return const User(
      id: 1,
      name: '张三',
      email: 'zhangsan@example.com',
      avatar: 'https://example.com/avatar.jpg',
      isActive: true,
    );
  }
}
